package com.sw.funfuck.common.enums;

/**
 * DiscussStatisitcEnum
 *
 * @author Johnathan
 **/
public enum DiscussStatisitcEnum {

    NUM_OF_DOSSIER(0, "the num of dossiers"),
    NUM_OF_CRIMINAL(1, "the num of criminal"),
    NUM_OF_CRIMINAL_TEAM(2, "the num of criminal team");

    private int itemType;
    private String itemName;

    private DiscussStatisitcEnum(int itemType, String itemName) {
        this.itemType = itemType;
        this.itemName = itemName;
    }

    /**
     * 根据类别获取对应的状态
     *
     * @param itemType
     * @return
     */
    public static DiscussStatisitcEnum getDossierStatisitcItemType(int itemType) {
        for (DiscussStatisitcEnum dossierStatisitcItemTypeEnum : DiscussStatisitcEnum.values()) {
            if (dossierStatisitcItemTypeEnum.getItemType() == itemType) {
                return dossierStatisitcItemTypeEnum;
            }
        }
        return null;
    }

    public static DiscussStatisitcEnum getDossierStatisitcItemType(String itemName) {
        for (DiscussStatisitcEnum dossierStatisitcItemTypeEnum : DiscussStatisitcEnum.values()) {
            if (dossierStatisitcItemTypeEnum.getItemName().equals(itemName)) {
                return dossierStatisitcItemTypeEnum;
            }
        }
        return null;
    }

    public String getItemName() {
        return itemName;
    }

    public int getItemType() {
        return itemType;
    }

}
